package bairui.international.model.domain.jpa;

import com.lianjing.sh.project.authority.model.domain.jpa.TB_OperatorBase;

/**
 *
 * (管理员)TB_Admin
 *
 * @说明
 * <pre>

 * </pre>
 *
 * @see Help_TB_Admin#inheritance() 继承体系信息
 *
 */
@org.hibernate.annotations.DynamicInsert
@org.hibernate.annotations.DynamicUpdate

@javax.persistence.Entity(name="t_admin")
@com.lianjing.sh.processing.info.annotation.GenerateInfoModel
@SuppressWarnings("serial")
@com.lianjing.sh.model.common.annotation.Comment("管理员")
@com.lianjing.sh.processing.info.annotation.InfoComment("管理员")
public class TB_Admin
 extends TB_OperatorBase
 implements 
	com.lianjing.sh.model.common.stardard.TableModel<Long>,
	com.sh_lianjing.state.HasStatable,
	java.io.Serializable

{

	
	
	/**
	 * 必须属性赋值接口
	 */
	public static interface MustProperties{
		/** 操作者类型 */
		public com.lianjing.sh.project.authority.model.type.Type_Operator getOperatorType();
		/** 冻结标识 */
		public Boolean getFreezenFlag();
		/** 操作者名称 */
		public String getOperatorName();
		/** 用户名 */
		public String getUsername();
		/** 密码 */
		public String getPassword();
		/** 姓名 */
		public String getName();
		/** 工号 */
		public String getNumber();
		/** 手机号 */
		public String getMobilePhone();
		/** 性别 */
		public bairui.international.model.type.Type_Gender getGender();
		/** 在职状态 */
		public bairui.international.model.status.State_Employee getState();
		/** 修改默认密码标志 */
		public Boolean getChangeDefaultPasswordFlag();
	}
	
	/**
	 * 为必须属性赋值
	 */
	public TB_Admin properties(MustProperties properties) {
		this.setOperatorType(properties.getOperatorType());
		this.setFreezenFlag(properties.getFreezenFlag());
		this.setOperatorName(properties.getOperatorName());
		this.setUsername(properties.getUsername());
		this.setPassword(properties.getPassword());
		this.setName(properties.getName());
		this.setNumber(properties.getNumber());
		this.setMobilePhone(properties.getMobilePhone());
		this.setGender(properties.getGender());
		this.setState(properties.getState());
		this.setChangeDefaultPasswordFlag(properties.getChangeDefaultPasswordFlag());
		return this;
	}
	
	/**
	 *	必须属性构造函数
	 */
	public TB_Admin(MustProperties properties) {
		this.properties(properties);
	}
	
	
	/**
	 * 可选单属性赋值接口
	 */
	public static interface OptionalSingleProperties{
		/** 邮箱 */
		public String getMail();
		/** 座机号 */
		public String getFixedPhone();
		/** 备注 */
		public String getComment();
	}
	
	/**
	 * 为可选单属性赋值
	 */
	public TB_Admin properties(OptionalSingleProperties properties) {
		this.setMail(properties.getMail());
		this.setFixedPhone(properties.getFixedPhone());
		this.setComment(properties.getComment());
		return this;
	}
	
	
	
	public TB_Admin(MustProperties must, OptionalSingleProperties optionalSingle) {
		this.properties(must);
		this.properties(optionalSingle);
	}
	
	/**
	 * 仅当前必须属性赋值接口
	 */
	public static interface CurrentMustProperties{
		/** 姓名 */
		public String getName();
		/** 工号 */
		public String getNumber();
		/** 手机号 */
		public String getMobilePhone();
		/** 性别 */
		public bairui.international.model.type.Type_Gender getGender();
		/** 在职状态 */
		public bairui.international.model.status.State_Employee getState();
		/** 修改默认密码标志 */
		public Boolean getChangeDefaultPasswordFlag();
	}
	
	/**
	 * 为仅当前必须属性赋值
	 */
	public TB_Admin properties(CurrentMustProperties properties) {
		this.setName(properties.getName());
		this.setNumber(properties.getNumber());
		this.setMobilePhone(properties.getMobilePhone());
		this.setGender(properties.getGender());
		this.setState(properties.getState());
		this.setChangeDefaultPasswordFlag(properties.getChangeDefaultPasswordFlag());
		return this;
	}
	
	/**
	 * 仅当前可选单属性赋值接口
	 */
	public static interface CurrentOptionalSingleProperties{
		/** 邮箱 */
		public String getMail();
		/** 座机号 */
		public String getFixedPhone();
		/** 备注 */
		public String getComment();
	}
	
	/**
	 * 为仅当前可选单属性赋值
	 */
	public TB_Admin properties(CurrentOptionalSingleProperties properties) {
		this.setMail(properties.getMail());
		this.setFixedPhone(properties.getFixedPhone());
		this.setComment(properties.getComment());
		return this;
	}
	
	public TB_Admin(
		@lombok.NonNull com.lianjing.sh.project.authority.model.domain.jpa.TB_OperatorBase bean,
		CurrentMustProperties mustProperties,
		CurrentOptionalSingleProperties optionalProperties
	) {
		this(bean);
		this.properties(mustProperties);
		this.properties(optionalProperties);
	}
	
	public TB_Admin(
		@lombok.NonNull com.lianjing.sh.project.authority.model.domain.jpa.TB_OperatorBase bean
	) {
		update(bean);
	}
	
	public TB_Admin update(com.lianjing.sh.project.authority.model.domain.jpa.TB_OperatorBase bean){
		this.setId(bean.getId());
		this.setCreateTime(bean.getCreateTime());
		this.setModifyTime(bean.getModifyTime());
		this.setOrderValue(bean.getOrderValue());
		this.setCreatedRoleBases(bean.getCreatedRoleBases());
		this.setLastModifiedRoleBases(bean.getLastModifiedRoleBases());
		this.setCreatedRoleGroups(bean.getCreatedRoleGroups());
		this.setLastModifiedRoleGroups(bean.getLastModifiedRoleGroups());
		this.setOperatorType(bean.getOperatorType());
		this.setFreezenFlag(bean.getFreezenFlag());
		this.setRoleBases(bean.getRoleBases());
		this.setOperatorName(bean.getOperatorName());
		this.setCreatedNoticeBases(bean.getCreatedNoticeBases());
		this.setLastModifiedNoticeBases(bean.getLastModifiedNoticeBases());
		this.setNoticeBases(bean.getNoticeBases());
		this.setUsername(bean.getUsername());
		this.setPassword(bean.getPassword());
		return this;
	}
	
	
	/**
	 * 更新属性内部类
	 */
	public abstract class UpdateProperties {
	
		public UpdateProperties() throws Exception {
			Integer orderValue = getOrderValue(TB_Admin.this);
			if(isOverride_getOrderValue){
				TB_Admin.this.setOrderValue(orderValue);
			}
	
			java.util.List<com.lianjing.sh.project.authority.model.domain.jpa.TB_RoleBase> createdRoleBases = getCreatedRoleBases(TB_Admin.this);
			if(isOverride_getCreatedRoleBases){
				TB_Admin.this.setCreatedRoleBases(createdRoleBases);
			}
	
			java.util.List<com.lianjing.sh.project.authority.model.domain.jpa.TB_RoleBase> lastModifiedRoleBases = getLastModifiedRoleBases(TB_Admin.this);
			if(isOverride_getLastModifiedRoleBases){
				TB_Admin.this.setLastModifiedRoleBases(lastModifiedRoleBases);
			}
	
			java.util.List<com.lianjing.sh.project.authority.model.domain.jpa.TB_RoleGroup> createdRoleGroups = getCreatedRoleGroups(TB_Admin.this);
			if(isOverride_getCreatedRoleGroups){
				TB_Admin.this.setCreatedRoleGroups(createdRoleGroups);
			}
	
			java.util.List<com.lianjing.sh.project.authority.model.domain.jpa.TB_RoleGroup> lastModifiedRoleGroups = getLastModifiedRoleGroups(TB_Admin.this);
			if(isOverride_getLastModifiedRoleGroups){
				TB_Admin.this.setLastModifiedRoleGroups(lastModifiedRoleGroups);
			}
	
			com.lianjing.sh.project.authority.model.type.Type_Operator operatorType = getOperatorType(TB_Admin.this);
			if(isOverride_getOperatorType){
				TB_Admin.this.setOperatorType(operatorType);
			}
	
			Boolean freezenFlag = getFreezenFlag(TB_Admin.this);
			if(isOverride_getFreezenFlag){
				TB_Admin.this.setFreezenFlag(freezenFlag);
			}
	
			java.util.List<com.lianjing.sh.project.authority.model.domain.jpa.TB_RoleBase> roleBases = getRoleBases(TB_Admin.this);
			if(isOverride_getRoleBases){
				TB_Admin.this.setRoleBases(roleBases);
			}
	
			String operatorName = getOperatorName(TB_Admin.this);
			if(isOverride_getOperatorName){
				TB_Admin.this.setOperatorName(operatorName);
			}
	
			java.util.List<com.lianjing.sh.project.authority.model.domain.jpa.TB_NoticeBase> createdNoticeBases = getCreatedNoticeBases(TB_Admin.this);
			if(isOverride_getCreatedNoticeBases){
				TB_Admin.this.setCreatedNoticeBases(createdNoticeBases);
			}
	
			java.util.List<com.lianjing.sh.project.authority.model.domain.jpa.TB_NoticeBase> lastModifiedNoticeBases = getLastModifiedNoticeBases(TB_Admin.this);
			if(isOverride_getLastModifiedNoticeBases){
				TB_Admin.this.setLastModifiedNoticeBases(lastModifiedNoticeBases);
			}
	
			java.util.List<com.lianjing.sh.project.authority.model.domain.jpa.TB_NoticeBase> noticeBases = getNoticeBases(TB_Admin.this);
			if(isOverride_getNoticeBases){
				TB_Admin.this.setNoticeBases(noticeBases);
			}
	
			String username = getUsername(TB_Admin.this);
			if(isOverride_getUsername){
				TB_Admin.this.setUsername(username);
			}
	
			String password = getPassword(TB_Admin.this);
			if(isOverride_getPassword){
				TB_Admin.this.setPassword(password);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_Role> roles = getRoles(TB_Admin.this);
			if(isOverride_getRoles){
				TB_Admin.this.setRoles(roles);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_Group> groups = getGroups(TB_Admin.this);
			if(isOverride_getGroups){
				TB_Admin.this.setGroups(groups);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_Position> positions = getPositions(TB_Admin.this);
			if(isOverride_getPositions){
				TB_Admin.this.setPositions(positions);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_Department> departments = getDepartments(TB_Admin.this);
			if(isOverride_getDepartments){
				TB_Admin.this.setDepartments(departments);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_Department> leadDepartment = getLeadDepartment(TB_Admin.this);
			if(isOverride_getLeadDepartment){
				TB_Admin.this.setLeadDepartment(leadDepartment);
			}
	
			String name = getName(TB_Admin.this);
			if(isOverride_getName){
				TB_Admin.this.setName(name);
			}
	
			String number = getNumber(TB_Admin.this);
			if(isOverride_getNumber){
				TB_Admin.this.setNumber(number);
			}
	
			String mobilePhone = getMobilePhone(TB_Admin.this);
			if(isOverride_getMobilePhone){
				TB_Admin.this.setMobilePhone(mobilePhone);
			}
	
			String mail = getMail(TB_Admin.this);
			if(isOverride_getMail){
				TB_Admin.this.setMail(mail);
			}
	
			String fixedPhone = getFixedPhone(TB_Admin.this);
			if(isOverride_getFixedPhone){
				TB_Admin.this.setFixedPhone(fixedPhone);
			}
	
			bairui.international.model.type.Type_Gender gender = getGender(TB_Admin.this);
			if(isOverride_getGender){
				TB_Admin.this.setGender(gender);
			}
	
			String comment = getComment(TB_Admin.this);
			if(isOverride_getComment){
				TB_Admin.this.setComment(comment);
			}
	
			bairui.international.model.status.State_Employee state = getState(TB_Admin.this);
			if(isOverride_getState){
				TB_Admin.this.setState(state);
			}
	
			Boolean changeDefaultPasswordFlag = getChangeDefaultPasswordFlag(TB_Admin.this);
			if(isOverride_getChangeDefaultPasswordFlag){
				TB_Admin.this.setChangeDefaultPasswordFlag(changeDefaultPasswordFlag);
			}
		}
	
		public TB_Admin up(){
			return TB_Admin.this;
		}
	
		/** 排序值 */
		private boolean isOverride_getOrderValue = true;
		public Integer getOrderValue(TB_Admin it) throws Exception { 
			isOverride_getOrderValue = false; 
			return null;
		}
		/** 创建的角色基础 */
		private boolean isOverride_getCreatedRoleBases = true;
		public java.util.List<com.lianjing.sh.project.authority.model.domain.jpa.TB_RoleBase> getCreatedRoleBases(TB_Admin it) throws Exception { 
			isOverride_getCreatedRoleBases = false; 
			return null;
		}
		/** 最后修改的角色基础 */
		private boolean isOverride_getLastModifiedRoleBases = true;
		public java.util.List<com.lianjing.sh.project.authority.model.domain.jpa.TB_RoleBase> getLastModifiedRoleBases(TB_Admin it) throws Exception { 
			isOverride_getLastModifiedRoleBases = false; 
			return null;
		}
		/** 创建的角色组 */
		private boolean isOverride_getCreatedRoleGroups = true;
		public java.util.List<com.lianjing.sh.project.authority.model.domain.jpa.TB_RoleGroup> getCreatedRoleGroups(TB_Admin it) throws Exception { 
			isOverride_getCreatedRoleGroups = false; 
			return null;
		}
		/** 最后修改的角色组 */
		private boolean isOverride_getLastModifiedRoleGroups = true;
		public java.util.List<com.lianjing.sh.project.authority.model.domain.jpa.TB_RoleGroup> getLastModifiedRoleGroups(TB_Admin it) throws Exception { 
			isOverride_getLastModifiedRoleGroups = false; 
			return null;
		}
		/** 操作者类型 */
		private boolean isOverride_getOperatorType = true;
		public com.lianjing.sh.project.authority.model.type.Type_Operator getOperatorType(TB_Admin it) throws Exception { 
			isOverride_getOperatorType = false; 
			return null;
		}
		/** 冻结标识 */
		private boolean isOverride_getFreezenFlag = true;
		public Boolean getFreezenFlag(TB_Admin it) throws Exception { 
			isOverride_getFreezenFlag = false; 
			return null;
		}
		/** 角色基础 */
		private boolean isOverride_getRoleBases = true;
		public java.util.List<com.lianjing.sh.project.authority.model.domain.jpa.TB_RoleBase> getRoleBases(TB_Admin it) throws Exception { 
			isOverride_getRoleBases = false; 
			return null;
		}
		/** 操作者名称 */
		private boolean isOverride_getOperatorName = true;
		public String getOperatorName(TB_Admin it) throws Exception { 
			isOverride_getOperatorName = false; 
			return null;
		}
		/** 创建的通知基础 */
		private boolean isOverride_getCreatedNoticeBases = true;
		public java.util.List<com.lianjing.sh.project.authority.model.domain.jpa.TB_NoticeBase> getCreatedNoticeBases(TB_Admin it) throws Exception { 
			isOverride_getCreatedNoticeBases = false; 
			return null;
		}
		/** 最后修改的通知基础 */
		private boolean isOverride_getLastModifiedNoticeBases = true;
		public java.util.List<com.lianjing.sh.project.authority.model.domain.jpa.TB_NoticeBase> getLastModifiedNoticeBases(TB_Admin it) throws Exception { 
			isOverride_getLastModifiedNoticeBases = false; 
			return null;
		}
		/** 通知基础 */
		private boolean isOverride_getNoticeBases = true;
		public java.util.List<com.lianjing.sh.project.authority.model.domain.jpa.TB_NoticeBase> getNoticeBases(TB_Admin it) throws Exception { 
			isOverride_getNoticeBases = false; 
			return null;
		}
		/** 用户名 */
		private boolean isOverride_getUsername = true;
		public String getUsername(TB_Admin it) throws Exception { 
			isOverride_getUsername = false; 
			return null;
		}
		/** 密码 */
		private boolean isOverride_getPassword = true;
		public String getPassword(TB_Admin it) throws Exception { 
			isOverride_getPassword = false; 
			return null;
		}
		/** 角色 */
		private boolean isOverride_getRoles = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_Role> getRoles(TB_Admin it) throws Exception { 
			isOverride_getRoles = false; 
			return null;
		}
		/** 群组 */
		private boolean isOverride_getGroups = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_Group> getGroups(TB_Admin it) throws Exception { 
			isOverride_getGroups = false; 
			return null;
		}
		/** 职位 */
		private boolean isOverride_getPositions = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_Position> getPositions(TB_Admin it) throws Exception { 
			isOverride_getPositions = false; 
			return null;
		}
		/** 部门 */
		private boolean isOverride_getDepartments = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_Department> getDepartments(TB_Admin it) throws Exception { 
			isOverride_getDepartments = false; 
			return null;
		}
		/** 负责的部门 */
		private boolean isOverride_getLeadDepartment = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_Department> getLeadDepartment(TB_Admin it) throws Exception { 
			isOverride_getLeadDepartment = false; 
			return null;
		}
		/** 姓名 */
		private boolean isOverride_getName = true;
		public String getName(TB_Admin it) throws Exception { 
			isOverride_getName = false; 
			return null;
		}
		/** 工号 */
		private boolean isOverride_getNumber = true;
		public String getNumber(TB_Admin it) throws Exception { 
			isOverride_getNumber = false; 
			return null;
		}
		/** 手机号 */
		private boolean isOverride_getMobilePhone = true;
		public String getMobilePhone(TB_Admin it) throws Exception { 
			isOverride_getMobilePhone = false; 
			return null;
		}
		/** 邮箱 */
		private boolean isOverride_getMail = true;
		public String getMail(TB_Admin it) throws Exception { 
			isOverride_getMail = false; 
			return null;
		}
		/** 座机号 */
		private boolean isOverride_getFixedPhone = true;
		public String getFixedPhone(TB_Admin it) throws Exception { 
			isOverride_getFixedPhone = false; 
			return null;
		}
		/** 性别 */
		private boolean isOverride_getGender = true;
		public bairui.international.model.type.Type_Gender getGender(TB_Admin it) throws Exception { 
			isOverride_getGender = false; 
			return null;
		}
		/** 备注 */
		private boolean isOverride_getComment = true;
		public String getComment(TB_Admin it) throws Exception { 
			isOverride_getComment = false; 
			return null;
		}
		/** 在职状态 */
		private boolean isOverride_getState = true;
		public bairui.international.model.status.State_Employee getState(TB_Admin it) throws Exception { 
			isOverride_getState = false; 
			return null;
		}
		/** 修改默认密码标志 */
		private boolean isOverride_getChangeDefaultPasswordFlag = true;
		public Boolean getChangeDefaultPasswordFlag(TB_Admin it) throws Exception { 
			isOverride_getChangeDefaultPasswordFlag = false; 
			return null;
		}
	
	}
	
	
	/**
	 * 构造函数
	 */
	public TB_Admin() {
	}
	
	public TB_Admin(
		@lombok.NonNull Long id
	) {
		this.setId(id);
	}
	
	public TB_Admin(
		@lombok.NonNull TB_Admin bean
	) {
		this.setId(bean.getId());
		this.setCreateTime(bean.getCreateTime());
		this.setModifyTime(bean.getModifyTime());
		this.setOrderValue(bean.getOrderValue());
		this.setCreatedRoleBases(bean.getCreatedRoleBases());
		this.setLastModifiedRoleBases(bean.getLastModifiedRoleBases());
		this.setCreatedRoleGroups(bean.getCreatedRoleGroups());
		this.setLastModifiedRoleGroups(bean.getLastModifiedRoleGroups());
		this.setOperatorType(bean.getOperatorType());
		this.setFreezenFlag(bean.getFreezenFlag());
		this.setRoleBases(bean.getRoleBases());
		this.setOperatorName(bean.getOperatorName());
		this.setCreatedNoticeBases(bean.getCreatedNoticeBases());
		this.setLastModifiedNoticeBases(bean.getLastModifiedNoticeBases());
		this.setNoticeBases(bean.getNoticeBases());
		this.setUsername(bean.getUsername());
		this.setPassword(bean.getPassword());
		this.setRoles(bean.getRoles());
		this.setGroups(bean.getGroups());
		this.setPositions(bean.getPositions());
		this.setDepartments(bean.getDepartments());
		this.setLeadDepartment(bean.getLeadDepartment());
		this.setName(bean.getName());
		this.setNumber(bean.getNumber());
		this.setMobilePhone(bean.getMobilePhone());
		this.setMail(bean.getMail());
		this.setFixedPhone(bean.getFixedPhone());
		this.setGender(bean.getGender());
		this.setComment(bean.getComment());
		this.setState(bean.getState());
		this.setChangeDefaultPasswordFlag(bean.getChangeDefaultPasswordFlag());
		this.setCreator(bean.getCreator());
		this.setLastModifier(bean.getLastModifier());
	}
	
	

	


	/**
	 * 属性
	 */
	@com.lianjing.sh.model.common.annotation.Comment("角色")
	@com.lianjing.sh.processing.info.annotation.InfoComment("角色")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.ManyToMany(mappedBy="admins")
	private java.util.List<bairui.international.model.domain.jpa.TB_Role> roles;

	@com.lianjing.sh.model.common.annotation.Comment("群组")
	@com.lianjing.sh.processing.info.annotation.InfoComment("群组")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.ManyToMany(mappedBy="admins")
	private java.util.List<bairui.international.model.domain.jpa.TB_Group> groups;

	@com.lianjing.sh.model.common.annotation.Comment("职位")
	@com.lianjing.sh.processing.info.annotation.InfoComment("职位")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.ManyToMany()
	private java.util.List<bairui.international.model.domain.jpa.TB_Position> positions;

	@com.lianjing.sh.model.common.annotation.Comment("部门")
	@com.lianjing.sh.processing.info.annotation.InfoComment("部门")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.ManyToMany()
	private java.util.List<bairui.international.model.domain.jpa.TB_Department> departments;

	@com.lianjing.sh.model.common.annotation.Comment("负责的部门")
	@com.lianjing.sh.processing.info.annotation.InfoComment("负责的部门")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.OneToMany(mappedBy="head")
	private java.util.List<bairui.international.model.domain.jpa.TB_Department> leadDepartment;

	@com.lianjing.sh.model.common.annotation.Comment("姓名")
	@com.lianjing.sh.processing.info.annotation.InfoComment("姓名")
	@javax.persistence.Column(name="name", nullable=false, length=20)
	private String name;

	@com.lianjing.sh.model.common.annotation.Comment("工号")
	@com.lianjing.sh.processing.info.annotation.InfoComment("工号")
	@javax.persistence.Column(name="number", unique=true, nullable=false, length=32)
	private String number;

	@com.lianjing.sh.model.common.annotation.Comment("手机号")
	@com.lianjing.sh.processing.info.annotation.InfoComment("手机号")
	@javax.persistence.Column(name="mobilePhone", unique=true, nullable=false, length=18)
	private String mobilePhone;

	@com.lianjing.sh.model.common.annotation.Comment("邮箱")
	@com.lianjing.sh.processing.info.annotation.InfoComment("邮箱")
	@javax.persistence.Column(name="mail", unique=true, length=200)
	private String mail;

	@com.lianjing.sh.model.common.annotation.Comment("座机号")
	@com.lianjing.sh.processing.info.annotation.InfoComment("座机号")
	@javax.persistence.Column(name="fixedPhone", length=18)
	private String fixedPhone;

	@com.lianjing.sh.model.common.annotation.Comment("性别")
	@com.lianjing.sh.processing.info.annotation.InfoComment("性别")
	@javax.persistence.Enumerated(javax.persistence.EnumType.STRING)
	@javax.persistence.Column(name="gender", nullable=false)
	private bairui.international.model.type.Type_Gender gender;

	@com.lianjing.sh.model.common.annotation.Comment("备注")
	@com.lianjing.sh.processing.info.annotation.InfoComment("备注")
	@javax.persistence.Column(name="comment", length=500)
	private String comment;

	@com.lianjing.sh.model.common.annotation.Comment("在职状态")
	@com.lianjing.sh.processing.info.annotation.InfoComment("在职状态")
	@javax.persistence.Enumerated(javax.persistence.EnumType.STRING)
	@javax.persistence.Column(name="state", nullable=false)
	private bairui.international.model.status.State_Employee state;

	@com.lianjing.sh.model.common.annotation.Comment("修改默认密码标志")
	@com.lianjing.sh.processing.info.annotation.InfoComment("修改默认密码标志")
	@javax.persistence.Column(name="changeDefaultPasswordFlag", nullable=false)
	private Boolean changeDefaultPasswordFlag;

	@com.lianjing.sh.model.common.annotation.Comment("创建者")
	@com.lianjing.sh.processing.info.annotation.InfoComment("创建者")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.JoinColumn(name="creator_id", nullable=true)
	@javax.persistence.ManyToOne()
	private bairui.international.model.domain.jpa.TB_Admin creator;

	@com.lianjing.sh.model.common.annotation.Comment("最后修改者")
	@com.lianjing.sh.processing.info.annotation.InfoComment("最后修改者")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.JoinColumn(name="lastModifier_id", nullable=true)
	@javax.persistence.ManyToOne()
	private bairui.international.model.domain.jpa.TB_Admin lastModifier;

	/** get[角色] */
	public java.util.List<bairui.international.model.domain.jpa.TB_Role> getRoles() {
		return this.roles;
	}

	/** get[群组] */
	public java.util.List<bairui.international.model.domain.jpa.TB_Group> getGroups() {
		return this.groups;
	}

	/** get[职位] */
	public java.util.List<bairui.international.model.domain.jpa.TB_Position> getPositions() {
		return this.positions;
	}

	/** get[部门] */
	public java.util.List<bairui.international.model.domain.jpa.TB_Department> getDepartments() {
		return this.departments;
	}

	/** get[负责的部门] */
	public java.util.List<bairui.international.model.domain.jpa.TB_Department> getLeadDepartment() {
		return this.leadDepartment;
	}

	/** get[姓名] */
	public String getName() {
		return this.name;
	}

	/** get[工号] */
	public String getNumber() {
		return this.number;
	}

	/** get[手机号] */
	public String getMobilePhone() {
		return this.mobilePhone;
	}

	/** get[邮箱] */
	public String getMail() {
		return this.mail;
	}

	/** get[座机号] */
	public String getFixedPhone() {
		return this.fixedPhone;
	}

	/** get[性别] */
	public bairui.international.model.type.Type_Gender getGender() {
		return this.gender;
	}

	/** get[备注] */
	public String getComment() {
		return this.comment;
	}

	/** get[在职状态] */
	public bairui.international.model.status.State_Employee getState() {
		return this.state;
	}

	/** get[修改默认密码标志] */
	public Boolean getChangeDefaultPasswordFlag() {
		return this.changeDefaultPasswordFlag;
	}

	/** get[创建者] */
	public bairui.international.model.domain.jpa.TB_Admin getCreator() {
		return this.creator;
	}

	/** get[最后修改者] */
	public bairui.international.model.domain.jpa.TB_Admin getLastModifier() {
		return this.lastModifier;
	}

	/** set[角色] */
	public void setRoles(java.util.List<bairui.international.model.domain.jpa.TB_Role> roles) {
		this.roles = roles;
	}

	/** set[群组] */
	public void setGroups(java.util.List<bairui.international.model.domain.jpa.TB_Group> groups) {
		this.groups = groups;
	}

	/** set[职位] */
	public void setPositions(java.util.List<bairui.international.model.domain.jpa.TB_Position> positions) {
		this.positions = positions;
	}

	/** set[部门] */
	public void setDepartments(java.util.List<bairui.international.model.domain.jpa.TB_Department> departments) {
		this.departments = departments;
	}

	/** set[负责的部门] */
	public void setLeadDepartment(java.util.List<bairui.international.model.domain.jpa.TB_Department> leadDepartment) {
		this.leadDepartment = leadDepartment;
	}

	/** set[姓名] */
	public void setName(String name) {
		this.name = name;
	}

	/** set[工号] */
	public void setNumber(String number) {
		this.number = number;
	}

	/** set[手机号] */
	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
	}

	/** set[邮箱] */
	public void setMail(String mail) {
		this.mail = mail;
	}

	/** set[座机号] */
	public void setFixedPhone(String fixedPhone) {
		this.fixedPhone = fixedPhone;
	}

	/** set[性别] */
	public void setGender(bairui.international.model.type.Type_Gender gender) {
		this.gender = gender;
	}

	/** set[备注] */
	public void setComment(String comment) {
		this.comment = comment;
	}

	/** set[在职状态] */
	public void setState(bairui.international.model.status.State_Employee state) {
		this.state = state;
	}

	/** set[修改默认密码标志] */
	public void setChangeDefaultPasswordFlag(Boolean changeDefaultPasswordFlag) {
		this.changeDefaultPasswordFlag = changeDefaultPasswordFlag;
	}

	/** set[创建者] */
	public void setCreator(bairui.international.model.domain.jpa.TB_Admin creator) {
		this.creator = creator;
	}

	/** set[最后修改者] */
	public void setLastModifier(bairui.international.model.domain.jpa.TB_Admin lastModifier) {
		this.lastModifier = lastModifier;
	}








	/** add[Roles] */
	public TB_Admin addRoles(bairui.international.model.domain.jpa.TB_Role ... roles){
		if(this.roles == null){
			this.roles = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_Role bean : roles){
			this.roles.add(bean);
		}
		return this;
	}
	/** add[Groups] */
	public TB_Admin addGroups(bairui.international.model.domain.jpa.TB_Group ... groups){
		if(this.groups == null){
			this.groups = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_Group bean : groups){
			this.groups.add(bean);
		}
		return this;
	}
	/** add[Positions] */
	public TB_Admin addPositions(bairui.international.model.domain.jpa.TB_Position ... positions){
		if(this.positions == null){
			this.positions = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_Position bean : positions){
			this.positions.add(bean);
		}
		return this;
	}
	/** add[Departments] */
	public TB_Admin addDepartments(bairui.international.model.domain.jpa.TB_Department ... departments){
		if(this.departments == null){
			this.departments = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_Department bean : departments){
			this.departments.add(bean);
		}
		return this;
	}
	/** add[LeadDepartment] */
	public TB_Admin addLeadDepartment(bairui.international.model.domain.jpa.TB_Department ... leadDepartment){
		if(this.leadDepartment == null){
			this.leadDepartment = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_Department bean : leadDepartment){
			bean.setHead(this);
			this.leadDepartment.add(bean);
		}
		return this;
	}
	
	/** remove[Roles] */
	public TB_Admin removeRoles(bairui.international.model.domain.jpa.TB_Role ... roles){
		if(this.roles == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_Role bean : roles){
			this.roles.remove(bean);
		}
		return this;
	}
	/** remove[Groups] */
	public TB_Admin removeGroups(bairui.international.model.domain.jpa.TB_Group ... groups){
		if(this.groups == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_Group bean : groups){
			this.groups.remove(bean);
		}
		return this;
	}
	/** remove[Positions] */
	public TB_Admin removePositions(bairui.international.model.domain.jpa.TB_Position ... positions){
		if(this.positions == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_Position bean : positions){
			this.positions.remove(bean);
		}
		return this;
	}
	/** remove[Departments] */
	public TB_Admin removeDepartments(bairui.international.model.domain.jpa.TB_Department ... departments){
		if(this.departments == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_Department bean : departments){
			this.departments.remove(bean);
		}
		return this;
	}
	/** remove[LeadDepartment] */
	public TB_Admin removeLeadDepartment(bairui.international.model.domain.jpa.TB_Department ... leadDepartment){
		if(this.leadDepartment == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_Department bean : leadDepartment){
			bean.setHead(null);
			this.leadDepartment.remove(bean);
		}
		return this;
	}
	
	/**
	 * contains[Roles]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsRoles(bairui.international.model.domain.jpa.TB_Role ... roles){
		if(this.roles == null || roles==null || roles.length<=0){
			return false;
		}
		return this.roles.containsAll(java.util.Arrays.asList(roles));
	}
	/**
	 * contains[Groups]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsGroups(bairui.international.model.domain.jpa.TB_Group ... groups){
		if(this.groups == null || groups==null || groups.length<=0){
			return false;
		}
		return this.groups.containsAll(java.util.Arrays.asList(groups));
	}
	/**
	 * contains[Positions]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsPositions(bairui.international.model.domain.jpa.TB_Position ... positions){
		if(this.positions == null || positions==null || positions.length<=0){
			return false;
		}
		return this.positions.containsAll(java.util.Arrays.asList(positions));
	}
	/**
	 * contains[Departments]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsDepartments(bairui.international.model.domain.jpa.TB_Department ... departments){
		if(this.departments == null || departments==null || departments.length<=0){
			return false;
		}
		return this.departments.containsAll(java.util.Arrays.asList(departments));
	}
	/**
	 * contains[LeadDepartment]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsLeadDepartment(bairui.international.model.domain.jpa.TB_Department ... leadDepartment){
		if(this.leadDepartment == null || leadDepartment==null || leadDepartment.length<=0){
			return false;
		}
		return this.leadDepartment.containsAll(java.util.Arrays.asList(leadDepartment));
	}
	

	/** take[创建者] */
	public bairui.international.model.domain.jpa.TB_Admin takeCreator(){
		if(null == this.creator){
			this.creator = new bairui.international.model.domain.jpa.TB_Admin();
		}
		return this.creator;
	}
	
	/** take[最后修改者] */
	public bairui.international.model.domain.jpa.TB_Admin takeLastModifier(){
		if(null == this.lastModifier){
			this.lastModifier = new bairui.international.model.domain.jpa.TB_Admin();
		}
		return this.lastModifier;
	}
	
	
	/** optional[创建者] */
	public java.util.Optional<bairui.international.model.domain.jpa.TB_Admin> optionalCreator() {
		return java.util.Optional.ofNullable(this.creator);
	}
	
	/** optional[最后修改者] */
	public java.util.Optional<bairui.international.model.domain.jpa.TB_Admin> optionalLastModifier() {
		return java.util.Optional.ofNullable(this.lastModifier);
	}
	

	/**
	 * 复写 hashCode
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		return prime * result + ((this.getId() == null) ? 0 : this.getId().hashCode());
	}
	
	/**
	 * 复写 equals
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj){
			return true;
		}
		if (obj == null){
			return false;
		}
		if (getClass() != obj.getClass()){
			return false;
		}
		TB_Admin other = (TB_Admin) obj;
		if (this.getId() == null) {
			return false;
		} else if (!this.getId().equals(other.getId())){
			return false;
		}
		return true;
	}
	

	/**
	 * 用来覆盖toString()的输出
	 */
	@javax.persistence.Transient
	private String toString;
	
	public void setToString(String toString) {
		this.toString = toString;
	}
	
	/**
	 * 复写 toString
	 */
	@Override
	public String toString() {
		if(null != this.toString){
			return this.toString;
		}
		String name = this.getName();
		if(null != name){
			return String.valueOf(name);
		}
		return super.toString();
	}	

	@javax.persistence.PrePersist
	public void prePersist() {
		com.lianjing.sh.web.security.authority.login.LoginUserInfo userInfo = com.lianjing.sh.web.security.authority.login.Util_Login.getInfo();
		Object user = null == userInfo ? null : userInfo.getUser();
		this.setCreateTime(new java.util.Date());
		this.setModifyTime(new java.util.Date());
		this.setCreator((bairui.international.model.domain.jpa.TB_Admin)user);
		this.setLastModifier((bairui.international.model.domain.jpa.TB_Admin)user);
	}
	
	@javax.persistence.PreUpdate
	public void preUpdate() {
		com.lianjing.sh.web.security.authority.login.LoginUserInfo userInfo = com.lianjing.sh.web.security.authority.login.Util_Login.getInfo();
		Object user = null == userInfo ? null : userInfo.getUser();
		this.setModifyTime(new java.util.Date());
		this.setLastModifier((bairui.international.model.domain.jpa.TB_Admin)user);
	}

	/**
	 * 状态相关
	 */
	public bairui.international.model.status.State_Employee state(){
		return this.getState();
	}


}
